<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=
    
    , initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .box {
        width: 100px;
        height: 100px;
        border: 1px solid gray;
    }
</style>

<body>
    <h1>wqdwfefefef</h1>
    <div class="box">

    </div>
    <!-- 确定上传图片 -->
    <button id="upbtn">上传</button>
    <input type="file" id="uplodebtn" multiple>

    <tbody id="tbodys">

        <th>
           <tr v-for="(item,index) in msg" key="index"></tr>
           <td>{{item.}}</td>
           <!-- <tr>
                <td>zs</td>
                <td>12</td>
                <td>女</td>
                <td>
                  <button>删除</button>
                  <button>修改</button>
                </td>
            </tr> -->
        </th>

    </tbody>
    <script src="./jquery.min.js"></script>
    <script>
        render()
        function render() {
            $.ajax({
                url: "/stroe/getproduct",
                type: "get",
                data: { name: "lisi" },
                success(msg) {
                    console.info(msg)

                }

            })
        }
        $("#uplodebtn").change(function (e) {
            var files = e.target.files
            //console.info(files)
            const formData = new FormData()
            formData.append('file', files[0]);
            $.ajax({
                url: "/stroe/getimg",
                type: "post",
                data: formData,
                cache: false,//不读取缓存中的结果
                contentType: false,//不采用jquery的方法对数据编码作额外的处理
                processData: false,//该属性表示不自动的转换数据类型
                success(msg) {
                    console.info("图片预览", msg)
                     
                    // $(".box").html(`<img src="./temp/${msg}" data-filename="${msg}"alt="" id="images">`)
                }
            })

        });
        $("#upbtn").click(function () {
            var imgpath = $("#images").data("filename")
            console.info(imgpath)
            $.ajax({
                url: "/stroe/addproducs",
                type: "post",
                data: {
                    imgpath: imgpath
                },
                success(msg) {
                   
                    console.info("图片",msg)
                   
                }
            })
        })






    </script>
</body>

</html>